import Mock from 'mockjs';
import loginAPI from './login/login_mock';
import teamAPI from './team/team_mock';
import infraAPI from './infrastructure/infra_mock';
import nodeAPI from './infrastructure/node_mock';
import userApi from './user/user_mock';
import menuApi from './menu/menu_mock';
import roleApi from './role/role_mock'
import configApi from './configmap/configmap_mock'
import repositoryApi from './repository/repository_mock'
import appManageApi from './appmanage/app_manage_mock'



// 登录相关url配置
Mock.mock(/\/api-user\/user-admin\/login/, 'post', loginAPI.login);
Mock.mock(/\/api-user\/user-admin\/logout/, 'patch', loginAPI.logout);
Mock.mock(/\/api-user\/user-admin\/info\.*/, 'post', loginAPI.getInfo)

// 登陆输入框失去焦点判断用户账号是否存在
Mock.mock(/\/api-user\/user-admin\/validateAccount/, 'post', loginAPI.checkLoginName);
Mock.mock(/\/api-user\/user-admin\/validatePassword/, 'post', loginAPI.checkLoginPass);

// 用户管理相关url配置
Mock.mock(/\/api-user\/user-admin\/user/, 'get', userApi.queryUserBase); // 用户查询
Mock.mock(/\/api-user\/user-admin\/user/, 'post', userApi.addUser); // 新增用户
Mock.mock(/\/api-user\/user-admin\/user/, 'patch', userApi.updateUser); // 修改用户
Mock.mock(/\/api-user\/role-admin\/combobox/, 'get', userApi.getRoles); // 得到角色信息,加载下拉选择框
Mock.mock(/\/api-user\/user-admin\/user/, 'delete', userApi.deleteUser); // 删除用户
Mock.mock(/\/api-user\/user-admin\/permission/, 'get', userApi.getUserInfo); // 得到用户登陆信息,权限菜单等
Mock.mock(/\/api-user\/user-admin\/password/, 'patch', userApi.addUser); // 修改用户登陆密码
Mock.mock(/\/api-user\/user-admin\/team\/combobox/, 'get', userApi.getTeamCombobox); // 得到登陆用户对应的团队信息
Mock.mock(/\/api-user\/user-admin\/namespace\/combobox/, 'get', userApi.getNamespaceCombobox); // 得到登陆用户对应的团队信息

// 功能菜单维护url配置
Mock.mock(/\/api-user\/function-admin\/root\/node/, 'get', menuApi.getRootNode); // 加载功能菜单树的根节点
Mock.mock(/\/api-user\/function-admin\/children\/node/, 'get', menuApi.getChildrenNode); // 加载功能菜单树的子节点
Mock.mock(/\/api-user\/function-admin\/function/, 'post', menuApi.addFunction); // 新增功能菜单
Mock.mock(/\/api-user\/function-admin\/function/, 'patch', menuApi.updateFunction); // 修改功能菜单
Mock.mock(/\/api-user\/function-admin\/exist/, 'post', menuApi.exist); // 判断同一级菜单下,是否相同的菜单名;
Mock.mock(/\/api-user\/function-admin\/function/, 'get', menuApi.getFunctionById); // 根据功能ID,得到当前功能菜单信息
Mock.mock(/\/api-user\/function-admin\/function/, 'delete', menuApi.deleteFunction); // 删除功能菜单

// 角色维护url配置
Mock.mock(/\/api-user\/role-admin\/role/, 'get', roleApi.getRole); // 得到角色信息
Mock.mock(/\/api-user\/role-admin\/role/, 'post', roleApi.addRole); // 新增角色
Mock.mock(/\/api-user\/role-admin\/role/, 'patch', roleApi.updateRole); // 修改角色
Mock.mock(/\/api-user\/role-admin\/role/, 'delete', roleApi.deleteRole); // 删除角色


//团队管理相关url配置
Mock.mock(/\/api-user\/team-admin\/team$/, 'get', teamAPI.teamQuery);//团队查询
Mock.mock(/\/api-user\/team-admin\/team/, 'post', teamAPI.teamSave);//图案新增
Mock.mock(/\/api-user\/team-admin\/team/, 'patch', teamAPI.teamSave);//团队修改
Mock.mock(/\/api-user\/team-admin\/team\/.*/, 'delete', teamAPI.teamDelete);//团队修改
Mock.mock(/\/api-user\/team-admin\/team\/[^a-zA-Z0-9]/g, 'get', teamAPI.teamQueryById);//团队明细查询
Mock.mock(/\/api-user\/team-admin\/namespace\/.*\/user/, 'post', teamAPI.teamAddUsers);//命名空间新增用户
Mock.mock(/\/api-user\/team-admin\/namespace\/.*\/user/, 'delete', teamAPI.teamAddUsers);//命名空间移除用户
Mock.mock(/\/api-user\/team-admin\/namespace\/.*\/user\/select/, 'get', teamAPI.userQueryByNamespace);//命名空间用户(已选)查询
Mock.mock(/\/api-user\/team-admin\/namespace\/.*\/user\/un-select/, 'get', teamAPI.teamUserQuery);//命名空间用户(备选)查询
Mock.mock(/\/api-user\/team-admin\/namaspace\/physical-group/, 'pathch', teamAPI.teamPhysicalGroupSet);//命名空间物理分组更新
Mock.mock(/\/api-user\/team-admin\/validate\/team-name\/.*\/.*/, 'get', teamAPI.validateName);//验证
Mock.mock(/\/api-user\/team-admin\/physical-group/, 'get', teamAPI.teamPhysicalGroupQuery);//验证

// 基础设施相关url配置

Mock.mock(/\/api-user\/infrastructure-admin\/physicial\/{queryKey}/, 'get', infraAPI.infraQuery);
Mock.mock(/\/api-user\/infrastructure-admin\/validate\/{type}\/{name}/, 'get', infraAPI.validateNameMap);
Mock.mock(/\/api-user\/infrastructure-admin\/physical/, 'post', infraAPI.infraSaveMap);
Mock.mock(/\/api-user\/infrastructure-admin\/physical\/{physicalId}/, 'patch', infraAPI.infraUpdateMap);
Mock.mock(/\/api-user\/infrastructure-admin\/physical\/.*/, 'delete', infraAPI.infraDeleteMap);

//节点维护
Mock.mock(/\/api-user\/infrastructure-admin\/node/, 'get', nodeAPI.nodeData);//节点信息查询
Mock.mock(/\/api-user\/infrastructure-admin\/partition/, 'get', nodeAPI.partition);
Mock.mock(/\/api-user\/infrastructure-admin\/partition/, 'post', nodeAPI.partition);


// 应用中心-服务配置相关URl配置
Mock.mock(/\/api-app\/config-admin\/all\/configmap/, 'get', configApi.getAllConfigMap); // 获得所有配置集与文件
Mock.mock(/\/api-app\/config-admin\/configmap/, 'get', configApi.getConfigMapByNamespace); // 根据用户ID,获得配置集和文件
Mock.mock(/\/api-app\/config-admin\/namespace\/combobox/, 'get', configApi.getNamespaceCombobox); // 获得空间名称
Mock.mock(/\/api-app\/config-admin\/configmap/, 'post', configApi.addConfigMap); // 新增配置集
Mock.mock(/\/api-app\/config-admin\/configmap/, 'delete', configApi.deleteConfigMap); // 删除配置集
Mock.mock(/\/api-app\/config-admin\/configfile/, 'get', configApi.getConfigFile); // 获取配置文件列表
Mock.mock(/\/api-app\/config-admin\/configfile/, 'post', configApi.addConfigFile); // 新增配置文件
Mock.mock(/\/api-app\/config-admin\/configfile/, 'patch', configApi.updateConfigFile); // 新增配置文件
Mock.mock(/\/api-app\/config-admin\/configfile/, 'delete', configApi.deleteConfigFile); // 删除单个配置文件
Mock.mock(/\/api-app\/config-admin\/batch\/configmap/, 'delete', configApi.deleteConfigFile); // 删除单个配置文件
Mock.mock(/\/api-app\/config-admin\/check\/configmap/, 'get', configApi.validateConfigMap); // 判断同一空间下是否存在相同的配置组
Mock.mock(/\/api-app\/config-admin\/check\/configfile/, 'get', configApi.validateConfigMap); // 判断同一个配置下面是否存在相同名称的配置文件

// 应用中心-应用管理相关URl配置
Mock.mock(/\/api-app\/app-admin\/app-create\/compose-file/, 'post', appManageApi.createAppByFileContent); // 创建应用
Mock.mock(/\/api-app\/app-admin\/app-create\/upload-file/, 'post', appManageApi.createAppByUploadFile); // 创建应用
Mock.mock(/\/api-app\/app-admin\/app-list/, 'get', appManageApi.queryApps); // 获取applist
Mock.mock(/\/api-app\/app-admin\/app-detailed\/1234567890/, 'get', appManageApi.getAppBase); // 根据应用ID获取应用信息
Mock.mock(/\/api-app\/app-admin\/pod-list/, 'get', appManageApi.getPodList); // 得到pod list
Mock.mock(/\/api-app\/app-admin\/horizontal-scale/, 'patch', appManageApi.horizontalScalingApp); // 水平伸缩应用
Mock.mock(/\/api-app\/app-admin\/hpa-detailed/, 'get', appManageApi.getAppHpa); // 应用自动伸缩参数获取
Mock.mock(/\/api-app\/app-admin\/auto-scale/, 'post', appManageApi.autoScaleApp); // 应用自动伸缩新增
Mock.mock(/\/api-app\/app-admin\/auto-scale/, 'patch', appManageApi.autoScaleApp); // 应用自动伸缩修改
Mock.mock(/\/api-app\/app-admin\/auto-scale/, 'delete', appManageApi.autoScaleApp); // 应用自动伸缩删除
Mock.mock(/\/api-app\/app-admin\/app/, 'delete', appManageApi.deleteApp); // 应用自动伸缩删除
Mock.mock(/\/api-app\/app-admin\/app-name/, 'get', appManageApi.getAppName); // 检验应用名称是否重复
Mock.mock(/\/api-app\/app-admin\/project-images/, 'get', appManageApi.getProjectImages); // 获得镜像仓库中镜像列表
Mock.mock(/\/api-app\/app-admin\/image-base/, 'get', appManageApi.getImageBase); // 获得镜像仓库中镜像列表
Mock.mock(/\/api-app\/app-admin\/image-tag/, 'get', appManageApi.getImageTag); // 获得镜像仓库中镜像列表
Mock.mock(/\/api-app\/app-admin\/image-base/, 'patch', appManageApi.depyoyApp); //  修改,或新增,镜像信息
Mock.mock(/\/api-app\/app-admin\/image-base/, 'delete', appManageApi.depyoyApp); //  修改,或新增,镜像信息
Mock.mock(/\/api-app\/app-admin\/app-create\/image/, 'patch', appManageApi.autoScaleApp); //  根据镜像信息部署应用
Mock.mock(/\/api-app\/app-admin\/app-name-kube/, 'get', appManageApi.getAppName); //  根据镜像信息部署应用



// 应用中心-镜像管理相关URL配置
Mock.mock(/\/api-app\/repository-admin\/private\/repository/, 'get', repositoryApi.queryPrivateRepository); // 获得私有镜像库镜像信息
Mock.mock(/\/api-app\/repository-admin\/image/, 'get', repositoryApi.getImage); // 根据镜像名称获得镜像信息




export default Mock;